package tech.xiaozai.rbac.service;

import tech.xiaozai.rbac.bo.MenuBO;
import tech.xiaozai.rbac.bo.PermissionBO;

import java.util.List;

/**
 * @author xiaozai
 * @version 1.0
 * @date 2020-09-21 09:35
 */
public interface PermissionService {

    /**
     *  获取菜单列表
     * @return
     */
    List<MenuBO> getMenus(List<String> roleIds);

    /**
     *  获取所有权限,树形
     * @return
     */
    List<PermissionBO> getAllPermissions();

    /**
     *  ...
     * @param permission
     */
    void updatePermission(PermissionBO permission);

    /**
     *  ...
     * @return
     */
    List<Long> getAllPermissionLeafIds();

    /**
     *  ...
     * @param roleId
     * @return
     */
    List<Long> getPermissionIdsOfRole(Long roleId);

    /**
     *  ...
     * @param roleId
     * @param permissionIds
     */
    void updatePermissionsOfRole(Long roleId, List<Long> permissionIds);
}
